<template>
	<view class="wanlshop-container">
		<!-- 自定义导航栏 -->
		<view class="navBarBox">
			<!-- 状态栏占位 -->
			<view class="statusBar" style="height: var(--status-bar-height);"></view>
			<!-- 真正的导航栏内容 -->
			<view class="navBar">
				<view>我的</view>
			</view>
		</view>
		<!-- #ifdef MP -->

		<!-- 		<view class="cu-custom text-white" :style="{color: common.appStyle.user_font_color == 'light'?'#ffffff':'#222222'}">
			<view class="cu-bar fixed" :style="{ height: $wanlshop.wanlsys().height + 'px', paddingTop: $wanlshop.wanlsys().top + 'px' }">
				<view class="action mp text-bold">
					<text class="wlIcon-shezhi" style="margin-right: 0.6em;" @tap="$wanlshop.auth('/pages/user/setting/setting')"></text>
					<text class="wlIcon-shiyongbangzhu1" @tap="help"></text>
				</view>
				<view class="bar-bg" v-if="headerOpacity > 0" :style="{ 
					height: $wanlshop.wanlsys().height + 'px', 
					opacity: headerOpacity,
					backgroundColor: common.appStyle.user_nav_color?common.appStyle.user_nav_color:'#f7f7f7',
					backgroundImage: 'url(' + $wanlshop.oss(common.appStyle.user_nav_image, 414, 0, 1, 'transparent', 'png') + ')'
				}"></view>
				<view class="bar-bg" v-if="headerOpacity > 0" :style="{ 
					height: $wanlshop.wanlsys().height + 'px', 
					opacity: headerOpacity,
					backgroundColor: common.appStyle.user_nav_color?common.appStyle.user_nav_color:'#f7f7f7',
					backgroundImage: 'url(' + $wanlshop.oss(common.appStyle.user_nav_image, 414, 0, 1, 'transparent', 'png') + ')'
				}"></view>
			</view>
		</view> -->
		<!-- #endif -->
		<!-- #ifndef MP -->
		<!-- 		<view class="cu-custom" :style="{color: common.appStyle.user_font_color == 'light'?'#ffffff':'#222222'}">
			<view class="cu-bar fixed" :style="{ height: $wanlshop.wanlsys().height + 'px', paddingTop: $wanlshop.wanlsys().top + 'px' }">
				<view class="text-lg" @tap="$wanlshop.auth('/pages/user/setting/user')">
					<view v-if="headerOpacity == 1">
						<view class="cu-avatar round margin-right-xs" :style="{ backgroundImage: 'url(' + $wanlshop.oss(user.avatar, 35, 35, 2, 'avatar') + ')' }"></view>
						<text style="color: #fff;" v-if="user.isLogin">{{ user.nickname }}</text>
						<text style="color: #fff;" v-else>登录 / 注册</text>
					</view>
				</view>
				<view class="bar-bg" v-if="headerOpacity > 0" :style="{ 
					height: $wanlshop.wanlsys().height + 'px', 
					opacity: headerOpacity,
					backgroundColor: common.appStyle.user_nav_color?common.appStyle.user_nav_color:'#f7f7f7',
					backgroundImage: 'url(' + $wanlshop.oss(common.appStyle.user_nav_image, 0, 50, 1, 'transparent', 'png') + ')',
					color: common.appStyle.user_font_color == 'light'?'#ffffff':'#222222'
				}"></view>
				<view class="action">
					<block>
						<text class="wlIcon-erweima" @tap="showModal('share')"></text>
						<text class="margin-right text-sm" @tap="showModal('share')">会员码</text>
					</block>
					<text class="wlIcon-shezhi" @tap="$wanlshop.auth('/pages/user/setting/setting')"></text>
					<text class="wlIcon-xiaoxizhongxin" @tap="$wanlshop.to('/pages/notice/notice')"></text>
					<view class="cu-tag badge" v-if="statistics.notice.notice +statistics.notice.order +statistics.notice.chat > 0">{{ statistics.notice.notice +statistics.notice.order +statistics.notice.chat }}</view>
				</view>
			</view>
		</view> -->
		<!-- #endif -->
		<view class="wanl-user" :style="{ 
			color: common.appStyle.user_font_color == 'light'?'#ffffff':'#222222'}">

			<view class="user" :style="{ paddingTop: $wanlshop.wanlsys().height + 'px' }">
				<view class="avatar margin-right-bj" @tap="portrai" style="border: 2rpx solid #fff;border-radius: 12rpx;">
					<image :src="$wanlshop.oss(user.avatar, 62, 62, 2, 'avatar')" mode="aspectFill"></image>
				</view>
				<view class="content" v-if="user.isLogin" style="position: relative;">
					<view class="text-xxl" style="color: #333333;font-weight: bold;font-size: 32rpx;margin-bottom: 10rpx;"
						@tap="$wanlshop.auth('/pages/user/setting/user')">{{ user.nickname }}</view>
					<view class="text-sm" @tap="$wanlshop.auth('/pages/user/vip/vip')">
						<view class="radius" v-if="user.level_name!=''" style="background: none;">
							LV：{{ user.level_name }}
							<!--<image src="/static/images/user/level1.png" v-if="user.level == 1" mode="widthFix" style="width: 120rpx;"></image>
							<image src="/static/images/user/level2.png" v-if="user.level == 2" mode="widthFix" style="width: 120rpx;"></image>-->
						</view>
						<view class="cu-tag sm radius bg-orange" v-if="false">
							用户积分 {{ user.score }}
						</view>
					</view>
					<view
						style="position: absolute;right: -30rpx;top: 20rpx;display: flex;background: linear-gradient( 90deg, #FE6B44 0%, #FFA186 100%);border-radius: 32rpx 0rpx 0rpx 32rpx;height: 56rpx;align-items: center;padding: 10rpx;color: #fff;"
						v-if="!user.shopInfo" @click="changeShop">
						<image src="/static/images/user/icon_change.png" mode="widthFix" style="width: 28rpx;margin-right: 10rpx;">
						</image> 商家中心
					</view>
				</view>
				<view class="content" @tap="$wanlshop.auth('/pages/user/auth/auth')" v-else>
					<view class="text-xxl" style="color: #fff;">登录 / 注册</view>
					<!-- <view class="cu-tag bg-orange sm radius">Hi</view> -->
					<view class="cu-tag sm radius" style="background-color: #a4443e;color: #fff;">Hi，欢迎登录</view>
				</view>
			</view>
			<!-- 			<view class="operate" v-if="false">
				<view class="text-sm" @tap="$wanlshop.auth('/pages/user/collect')">
					<text class="text-bold">{{ statistics.dynamic.collection }}</text>
					收藏夹
				</view>
				<view class="text-sm" @tap="$wanlshop.auth('/pages/user/follow')">
					<text class="text-bold">{{ statistics.dynamic.concern }}</text>
					关注店铺
				</view>
				<view class="text-sm" @tap="$wanlshop.auth('/pages/user/footprint')">
					<text class="text-bold">{{ statistics.dynamic.footprint }}</text>
					足迹
				</view>
				<view class="text-sm" @tap="$wanlshop.auth('/pages/user/order/order')">
					<text class="text-bold">{{ $wanlshop.toFormat(statistics.order.whole, 'hundred') }}</text>
					全部订单
				</view>
				
			</view> -->
			<view class="operate" style="align-items: center;margin: 0px 24rpx;padding: 40rpx;">

				<view class="text-sm" @tap="$wanlshop.auth('/pages/user/money/wallet')">
					<text style="font-size: 40rpx;margin-bottom: 36rpx;">{{ user.auction_money?user.auction_money:'0.00' }}</text>
					易货额
				</view>
				<view style="width: 1rpx;height: 40rpx;background-color: #D9C4AB;"></view>
				<view class="text-sm" @tap="$wanlshop.auth('/pages/user/money/money')">
					<text style="font-size: 40rpx;margin-bottom: 36rpx;">{{ user.money?user.money:'0.00' }}</text>
					余额
				</view>
				<view class="text-sm" @tap="$wanlshop.auth('/pages/user/money/contract_money')" v-if="false">
					<text>{{ user.contract_money?user.contract_money:'0.00' }}</text>
					多呗
				</view>
				<view style="width: 1rpx;height: 40rpx;background-color: rgba(255, 255, 255, 0.3);" v-if="false"></view>

				<view class="text-sm" @tap="$wanlshop.auth('/pages/user/money/token_money')" v-if="false">
					<text>{{ user.token_money?user.token_money:'0.00' }}</text>
					增值收益
				</view>
				<view style="width: 1rpx;height: 40rpx;background-color: rgba(255, 255, 255, 0.3);" v-if="false"></view>

				<view class="text-sm" @tap="$wanlshop.auth('/pages/user/money/score')" v-if="false">
					<text>{{ user.score?user.score:'0.00' }}</text>
					提货券
				</view>

			</view>
			<view class="activity padding-bj" v-if="false">
				<view class="bg-white radius grid text-center col-2 padding-lr-bj padding-tb-sm">
					<view class="solid-right flex justify-between" @tap="$wanlshop.auth('/pages/user/coupon/list')">
						<view class="content">
							<view class="wanl-black text-sm text-bold6">红包卡券</view>
							<view class="text-min text-orange">
								领取优惠券
								<text class="wlIcon-fanhui2 margin-left-xs"></text>
							</view>
						</view>
						<view class="cu-avatar"
							:style="{ backgroundImage: 'url(' + $wanlshop.appstc('/user/icon_card_bag.png') + ')' }"></view>
					</view>
					<view class="flex justify-between" @tap="$wanlshop.auth('/pages/user/signin/log')">
						<view class="content margin-left-bj">
							<view class="wanl-black text-sm text-bold6">我的积分</view>
							<view class="text-min text-orange">
								查看积分明细
								<text class="wlIcon-fanhui2 margin-left-xs"></text>
							</view>
						</view>
						<view class="cu-avatar"
							:style="{ backgroundImage: 'url(' + $wanlshop.appstc('/user/icon_super_vip.png') + ')' }"></view>
					</view>
				</view>
			</view>
		</view>
		<!-- 		<view class="wanl-user-order padding-sm margin-bj" style="margin-top: 25rpx;">
			<view class="project text-sm wanl-gray-dark">
				<view style="line-height: 1.8;" v-if="false" @tap="$wanlshop.auth('/pages/user/coupon/mycard')">
					<view class="wanl-pip text-lg text-bold6">{{ statistics.dynamic.coupon }}</view>
					我的卡券
				</view>
				<view style="line-height: 1.8;" @tap="$wanlshop.auth('/pages/user/money/money')">
					<view class="wanl-pip text-lg text-bold6">{{ user.money?user.money:'0.00' }}</view>
					余额
				</view>
				<view style="line-height: 1.8;" @tap="$wanlshop.auth('/pages/user/money/money')">
					<view class="wanl-pip text-lg text-bold6">{{ user.auction_money?user.auction_money:'0.00' }}</view>
					易货额
				</view>
				<view style="line-height: 1.8;" @tap="$wanlshop.auth('/pages/user/money/money')">
					<view class="wanl-pip text-lg text-bold6">{{ user.contract_money?user.contract_money:'0.00' }}</view>
					多呗
				</view>
				<view style="line-height: 1.8;" v-if="false" @tap="$wanlshop.auth('/pages/user/bank/bank')">
					<view class="wanl-pip text-lg text-bold6">{{ statistics.dynamic.accountbank }}</view>
					银行卡
				</view>
				<view style="line-height: 1.8;" @tap="$wanlshop.auth('/pages/user/signin/log')">
					<view class="wanl-pip text-lg text-bold6">{{ user.score?user.score:'0.00' }}</view>
					提货券
				</view>
				<view class="solid-left" v-if="false" @tap="$wanlshop.auth('/pages/user/money/list')">
					<text class="wlIcon-hongbao wanl-orange"></text>
					账单明细
				</view>
			</view>
		</view> -->
		<view style="display: flex;justify-content: space-between;margin: 0px 24rpx;flex-wrap: wrap;">
			<block v-if="!isShop">
				<view class="user-action" @tap="$wanlshop.auth('/pages/user/money/transfer')">
					<view>
						<image class="" src="/static/images/user/icon_zhuanzhang.png" mode="widthFix" style="width: 88rpx;"></image>
					</view>
					转账
				</view>
				<view class="user-action" @tap="showModal('share')">
					<view>
						<image class="" src="/static/images/user/icon_tuiguangma.png" mode="widthFix" style="width: 88rpx;"></image>
					</view>
					推广码
				</view>
				<view class="user-action" @tap="scanCode">
					<view>
						<image class="" src="/static/images/user/icon_saoma.png" mode="widthFix" style="width: 88rpx;"></image>
					</view>
					扫码
				</view>
			</block>
			<block v-else>
				<view class="user-action action-shop" @tap="$wanlshop.auth('/pages/user/money/transfer')">
					<image class="" src="/static/images/user/icon_zhuanzhang.png" mode="widthFix" style="width: 88rpx;"></image>
					转账
				</view>
				<view class="user-action action-shop" @tap="showModal('share')">
					<image class="" src="/static/images/user/icon_tuiguangma.png" mode="widthFix" style="width: 88rpx;"></image>
					推广码
				</view>
				<view class="user-action action-shop" @tap="scanCode">
					<image class="" src="/static/images/user/icon_saoma.png" mode="widthFix" style="width: 88rpx;"></image>
					扫码
				</view>
				<view class="user-action action-shop" @tap="handleShouKuan">
					<image class="" src="/static/images/user/icon_shoukuan.png" mode="widthFix" style="width: 88rpx;"></image>
					收款码
				</view>
			</block>
		</view>
		<view class="wanl-user-order padding-sm margin-bj" style="z-index: 2;position: relative;">
			<view
				style="font-weight: bold;margin-bottom: 40rpx;font-size: 33rpx;display: flex;align-items: center;justify-content: space-between;">
				全部订单<image src="/static/images/user/arrow_right.png" mode="widthFix" style="width: 48rpx;"
					@tap="$wanlshop.auth('/pages/user/order/order?state=1')"></image>
			</view>

			<view class="project text-sm wanl-gray-dark">
				<view @tap="$wanlshop.auth('/pages/user/order/order?state=1')" v-if="isShop">
					<!-- <text class="wlIcon-31daifukuan wanl-pip"></text> -->
					<view>
						<image class="" src="/static/images/user/icon_daizhifu.png" mode="widthFix" style="width: 64rpx;"></image>
					</view>
					待付款
					<view class="cu-tag badge bg-orange" v-if="statistics.order.pay > 0">
						{{ $wanlshop.toFormat(statistics.order.pay, 'hundred') }}
					</view>
				</view>
				<view @tap="$wanlshop.auth('/pages/user/order/order?state=2')">
					<!-- <text class="wlIcon-31daifahuo wanl-pip"></text> -->
					<view>
						<image class="" src="/static/images/user/icon_daifahuo.png" mode="widthFix" style="width: 64rpx;"></image>
					</view>
					待发货
					<view class="cu-tag badge bg-orange" v-if="statistics.order.delive > 0">
						{{ $wanlshop.toFormat(statistics.order.delive, 'hundred') }}
					</view>
				</view>
				<view @tap="$wanlshop.auth('/pages/user/order/order?state=3')">
					<!-- <text class="wlIcon-31daishouhuo wanl-pip"></text> -->
					<view>
						<image class="" src="/static/images/user/icon_daishouhuo.png" mode="widthFix" style="width: 64rpx;"></image>
					</view>
					待收货
					<view class="cu-tag badge bg-orange" v-if="statistics.order.receiving > 0">
						{{ $wanlshop.toFormat(statistics.order.receiving, 'hundred') }}
					</view>
				</view>
				<view @tap="$wanlshop.auth('/pages/user/order/order?state=4')">
					<view>
						<image class="" src="/static/images/user/icon_yiwancheng.png" mode="widthFix" style="width: 64rpx;"></image>
					</view>
					已完成
					<view class="cu-tag badge bg-orange" v-if="statistics.order.evaluate > 0">
						{{ $wanlshop.toFormat(statistics.order.evaluate, 'hundred') }}
					</view>
				</view>
			</view>
		</view>
		<view class="wanl-user-order padding-sm margin-bj" style="z-index: 2;position: relative;" v-if="!user.shopinfo">
			<view
				style="font-weight: bold;margin-bottom: 40rpx;font-size: 33rpx;display: flex;align-items: center;justify-content: space-between;">
				店铺管理
				<image src="/static/images/user/arrow_right.png" mode="widthFix" style="width: 48rpx;"
					@tap="$wanlshop.auth('/pages/user/goodsManage/goodsManage')"></image>
			</view>

			<view class="project text-sm wanl-gray-dark">
				<view @tap="$wanlshop.auth('/pages/user/goodsManage/sendGoods')">
					<view>
						<image class="" src="/static/images/user/icon_fabu.png" mode="widthFix" style="width: 64rpx;"></image>
					</view>
					发布商品
				</view>
				<view @tap="$wanlshop.auth('/pages/user/goodsManage/goodsManage?state=0')">
					<view>
						<image class="" src="/static/images/user/icon_shangjia.png" mode="widthFix" style="width: 64rpx;"></image>
					</view>
					上架商品
				</view>
				<view @tap="$wanlshop.auth('/pages/user/goodsManage/goodsManage?state=2')">
					<view>
						<image class="" src="/static/images/user/icon_xiajia.png" mode="widthFix" style="width: 64rpx;"></image>
					</view>
					下架商品
				</view>
				<view @tap="$wanlshop.auth('/pages/user/goodsManage/goodsManage?state=1')">
					<view>
						<image class="" src="/static/images/user/icon_daishenhe.png" mode="widthFix" style="width: 64rpx;"></image>
					</view>
					待审核商品
				</view>
			</view>
		</view>
		<view class="wanl-user-order padding-sm margin-bj" v-if="false">
			<view style="font-weight: 500;margin-bottom: 40rpx;">我的仓库</view>

			<view class="project text-sm wanl-gray-dark">
				<view @tap="$wanlshop.auth('/pages/user/order/rushorder?state=3')">
					<!-- <text class="wlIcon-31daifukuan wanl-pip"></text> -->
					<view>
						<image class="" src="/static/images/user/icon_canpai.png" mode="widthFix" style="width: 44rpx;"></image>
					</view>

					买货
					<view class="cu-tag badge bg-orange"
						v-if="statistics && statistics.rush_order && statistics.rush_order.pay > 0">
						{{ $wanlshop.toFormat(statistics.rush_order.pay, 'hundred') }}
					</view>
				</view>
				<view @tap="$wanlshop.auth('/pages/user/order/rushorder?state=4')">
					<!-- <text class="wlIcon-31daifahuo wanl-pip"></text> -->
					<view>
						<image class="" src="/static/images/user/icon_huokuan.png" mode="widthFix" style="width: 44rpx;"></image>
					</view>

					易货
					<view class="cu-tag badge bg-orange"
						v-if="statistics && statistics.rush_order && statistics.rush_order.sell > 0">
						{{ $wanlshop.toFormat(statistics.rush_order.sell, 'hundred') }}
					</view>
				</view>
				<view @tap="$wanlshop.auth('/pages/user/order/rushorder?state=8')">
					<!-- <text class="wlIcon-31daishouhuo wanl-pip"></text> -->
					<view>
						<image class="" src="/static/images/user/icon_cangkudingdan.png" mode="widthFix" style="width: 44rpx;">
						</image>
					</view>

					提货
					<view class="cu-tag badge bg-orange"
						v-if="statistics && statistics.rush_order && statistics.rush_order.delive > 0">
						{{ $wanlshop.toFormat(statistics.rush_order.delive, 'hundred') }}
					</view>
				</view>
				<view @tap="$wanlshop.auth('/pages/user/order/rushorder?state=5')">
					<!-- <text class="wlIcon-31daipingjia wanl-pip"></text> -->
					<view>
						<image class="" src="/static/images/user/icon_tihuodingdan.png" mode="widthFix" style="width: 44rpx;">
						</image>
					</view>

					已发货
					<view class="cu-tag badge bg-orange"
						v-if="statistics && statistics.rush_order && statistics.rush_order.finish > 0">
						{{ $wanlshop.toFormat(statistics.rush_order.finish, 'hundred') }}
					</view>
				</view>
			</view>
		</view>
		<view class="wanl-user-tool padding-sm padding-top-bj margin-lr-bj">
			<view
				style="font-weight: bold;margin-bottom: 40rpx;font-size: 33rpx;display: flex;align-items: center;justify-content: space-between;">
				其他服务</view>

			<view class="list text-sm grid col-4 wanl-gray-dark">
				<block v-if="!isShop">
					<view @tap="$wanlshop.auth('/pages/user/vip/vip')">
						<view>
							<image class="" src="/static/images/user/icon_huiyuan.png" mode="widthFix" style="width: 88rpx;"></image>
						</view>
						会员升级
					</view>
					<view @tap="$wanlshop.auth('/pages/user/distribution/team')">
						<view>
							<image class="" src="/static/images/user/icon_tuandui.png" mode="widthFix" style="width: 88rpx;"></image>
						</view>
						我的团队
					</view>
					<view @tap="app()">
						<view>
							<image class="" src="/static/images/user/icon_app.png" mode="widthFix" style="width: 88rpx;"></image>
						</view>
						APP下载
					</view>
					<view @tap="$wanlshop.auth('/pages/user/shop/applyShop')">
						<view>
							<image class="" src="/static/images/user/icon_shenqing.png" mode="widthFix" style="width: 88rpx;"></image>
						</view>
						申请店铺
					</view>
					<view @tap="$wanlshop.auth('/pages/user/comment/comment')">
						<view>
							<image class="" src="/static/images/user/icon_shoucang.png" mode="widthFix" style="width: 88rpx;"></image>
						</view>
						我的收藏
					</view>
					<view @tap="$wanlshop.auth('/pages/user/comment/comment')">
						<view>
							<image class="" src="/static/images/user/icon_pingjia.png" mode="widthFix" style="width: 88rpx;"></image>
						</view>
						我的评价
					</view>
					<view @tap="$wanlshop.auth('/pages/user/address/address')">
						<view>
							<image class="" src="/static/images/user/icon_dizhi.png" mode="widthFix" style="width: 88rpx;"></image>
						</view>
						地址管理
					</view>
					<view @tap="setting">
						<view>
							<image class="" src="/static/images/user/icon_shezhi.png" mode="widthFix" style="width: 88rpx;"></image>
						</view>
						我的设置
					</view>
				</block>
				<block v-else>
					<view @tap="$wanlshop.auth('/pages/user/address/address')">
						<view>
							<image class="" src="/static/images/user/icon_ziliao.png" mode="widthFix" style="width: 88rpx;"></image>
						</view>
						商家资料
					</view>
					<view @tap="$wanlshop.auth('/pages/user/goodsBuy/goodsBuy')">
						<view>
							<image class="" src="/static/images/user/icon_caigou.png" mode="widthFix" style="width: 88rpx;"></image>
						</view>
						采购专区
					</view>
				</block>
			</view>
		</view>
		<view class="wanl-you-like"
			:style="{ backgroundImage: 'url(' + $wanlshop.appstc('/common/guess_you_like_it.png') + ')' }" v-if="false">
		</view>
		<wanl-product v-if="false" :dataList="likeData" />
		<uni-load-more v-if="false" :status="status" :content-text="contentText" />
		<!-- 分享 -->
		<view class="cu-modal wanl-share " :class="modalName == 'share' ? 'show' : ''" @tap="hideModal()">
			<view v-if="modalName == 'share'" class="cu-dialog" @tap.stop="">
				<wanl-poster ref="wanlPoster" page="pages/user/auth/register" :scene="{qr:'u'}" @success="posterSuccess"
					@change="hideModal" />
			</view>
		</view>
		<view class="edgeInsetBottom"></view>
	</view>
</template>

<script>
	import { mapState } from 'vuex';
	export default {
		data() {
			return {
				modalName: '',
				headerOpacity: 0,
				// 上拉刷新
				reload: true,
				likeData: [],
				current_page: 1, //当前页码
				last_page: 1, //总页码
				status: 'loading',
				contentText: {
					contentdown: ' ',
					contentrefresh: '正在加载...',
					contentnomore: '没有更多数据了'
				},
				isShop: false
			};
		},
		computed: {
			...mapState(['user', 'statistics', 'common'])
		},
		onPullDownRefresh() {
			this.loadData();
		},
		onShow() {
			setTimeout(() => {
				uni.setNavigationBarColor({
					frontColor: this.$store.state.common.appStyle.user_font_color == 'light' ? '#ffffff' : '#000000',
					backgroundColor: this.$store.state.common.appStyle.user_nav_color
				})
			}, 200);
			this.loadData();
		},
		onLoad(query) {
			if (query.hasOwnProperty('scene')) {
				let scene = decodeURIComponent(query.scene);
				scene = this.$wanlshop.getParam(scene);
				console.log('小程序码进入：', scene);
			}
			// if (this.$store.state.user.isLogin) {
			this.loadData();
			// }
			this.loadlikeData();
		},
		onPageScroll(e) {
			let tmpY = 50;
			e.scrollTop = e.scrollTop > tmpY ? 50 : e.scrollTop; //如果当前高度大于250则250否则当前高度
			this.headerOpacity = e.scrollTop * (1 / tmpY); //$headerOpacity 赋值当前高度x（1÷250）
		},
		onReachBottom() {
			//判断是否最后一页
			if (this.current_page >= this.last_page) {
				this.status = 'noMore';
			} else {
				this.reload = false;
				this.current_page = this.current_page + 1; //页码+1
				this.status = 'loading';
				this.loadlikeData();
			}
		},
		methods: {
			changeShop() {
				this.isShop = !this.isShop
			},
			handleShouKuan() {
				uni.navigateTo({
					url: `/pages/user/subtract/subtract?code=${this.user.share_code}`
				})
			},
			async loadData() {
				await uni.request({
					url: '/wanlshop/user/refresh',
					method: 'POST',
					success: res => {
						this.$store.commit('statistics/edit', res.data.statistics);
						this.$store.commit('user/setUserInfo', res.data.userinfo);
					}
				});
				uni.stopPullDownRefresh();
			},
			// 滚动底部加载猜你喜欢
			async loadlikeData() {
				await uni.request({
					url: '/wanlshop/product/likes?pages=user',
					data: {
						page: this.current_page
					},
					success: res => {
						this.likeData = this.reload ? res.data.data : this.likeData.concat(res.data.data); //评论数据 追加
						this.current_page = res.data.current_page; //当前页码
						this.last_page = res.data.last_page; //总页码
						this.status = res.data.total == 0 ? 'noMore' : 'more';
					}
				});
			},
			// 弹出层
			showModal(name) {
				if (name == 'share') {
					if (this.user.isLogin) {
						this.$wanlshop.to(`/pages/user/promotion/promotion?code=${this.user.share_code}`);
					} else {
						this.$wanlshop.to('/pages/user/auth/auth');
					}
				} else {
					this.modalName = name;
				}
			},
			hideModal() {
				this.modalName = null;
			},
			posterSuccess(e) {},
			// 帮助
			help() {
				this.$wanlshop.to('/pages/user/help');
			},
			// 设置
			setting() {
				this.$wanlshop.to('/pages/user/setting/setting');
			},
			portrai() {
				this.$wanlshop.to('/pages/user/portrait/portrait');
			},
			app() {
				// #ifndef H5
				plus.runtime.openURL('https://shop.yikeshun.cn/down/');
				// #endif
				// #ifdef H5
				window.location.href = 'https://shop.yikeshun.cn/down/';
				// #endif

			},
			// 扫码
			scanCode() {
				// #ifndef H5
				uni.scanCode({
					success: res => {
						let query = this.$wanlshop.getParam(res.result),
							id = query.id;
						switch (query.qr) {
							case 'g':
								this.onGoods(id);
								break;
							case 'gr':
								this.$wanlshop.to(`/pages/apps/groups/goods?id=${id}&groups_id=${query.groups_id}`);
								break;
							case 'u':
								this.$wanlshop.to(`/pages/user/info?id=${id}`);
								break;
							case 'fu':
								this.$wanlshop.to(`/pages/apps/find/user?id=${id}`);
								break;
							case 'c':
								this.$wanlshop.on('/pages/category');
								break;
							case 'p':
								this.$wanlshop.to(`/pages/page/index?id=${id}`);
								break;
							case 's':
								this.onShop(id);
								break;
							case 'live':
								// #ifdef APP-PLUS || MP-WEIXIN
								this.$wanlshop.auth(`/pages/shop/live/live`);
								// #endif
								// #ifndef APP-PLUS || MP-WEIXIN
								this.$wanlshop.msg('目前只开放App和微信小程序直播');
								// #endif
								break;
							case 'chat':
								this.toChat(id);
								break;
						}
					}
				});
				// #endif
				// #ifdef H5
				this.$wanlshop.msg('暂不支持H5扫码');
				// #endif
			},
		}
	};
</script>

<style scoped lang="scss">
	.wanlshop-container {
		background: url("https://maileduo.oss-cn-shanghai.aliyuncs.com/uploads/20241231/a4564ccb9843401bdb8c253c873e7a64.png?x-oss-process=image/auto-orient,1/interlace,1/format,png/quality,q_90/sharpen,50/resize,m_mfit,w_1242") no-repeat top;
		background-size: 750rpx 1130rpx;
	}

	.cu-bar .action.mp:first-child>text[class*='wlIcon-'] {
		margin-left: 0;
	}

	.wanl-user {
		background-repeat: no-repeat;
		background-size: 100%;
		position: relative;
	}

	.wanl-user .user {
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 0 30rpx;
		padding-bottom: 30rpx;
	}

	.wanl-user .user .avatar {
		position: relative;
		height: 123rpx;
		width: 123rpx;
		/* border-radius: 5000rpx; */
		overflow: hidden;
		border: 3px solid rgba(255, 255, 255, .25);
	}

	.wanl-user .user .avatar image {
		height: 120rpx;
	}

	.wanl-user .user .avatar .tag {
		position: absolute;
		bottom: 0;
		right: 0;
	}

	.wanl-user .user .content {
		flex: 1;
	}

	/* 操作 */
	.wanl-user .operate {
		display: flex;
		justify-content: space-around;
		text-align: center;
		padding-bottom: 70rpx;
		line-height: 1.3;
		background: url('/static/images/user/u_bg.png') no-repeat;
		color: #333;
		background-size: 100%;
	}

	.wanl-user .operate text {
		display: block;
		font-size: 32rpx;
	}

	/* 活动 */
	.wanl-user .activity {
		position: absolute;
		width: 100%;
		bottom: -80rpx;
	}

	.wanl-user .activity .radius {
		border-radius: 24rpx;
	}

	.wanl-user .activity .cu-avatar {
		width: 69rpx;
		height: 69rpx;
		margin-right: 30rpx;
		background-color: transparent;
		/* border: 1px solid rgba(255,255,255,.6); */
	}

	.wanl-user .activity .content {
		text-align: left;
		height: 68rpx;
	}

	/* 订单 */
	.wanl-user-order {
		/* margin-top: 80rpx; */
		border-radius: 24rpx;
		background-color: white;
	}

	.wanl-user-order .title {
		display: flex;
		justify-content: space-between;
		align-items: flex-end;
	}

	.wanl-user-order .title text {}



	/* 状态 */
	.wanl-user-order .project {
		display: flex;
		justify-content: space-around;
		text-align: center;
	}

	.wanl-user-order .project>view {
		position: relative;
		flex: 1;
	}

	.wanl-user-order .project>view .cu-tag {
		top: -4rpx;
		right: 26rpx;
	}

	.wanl-user-order .project text {
		display: block;
		font-size: 50rpx;
		margin-bottom: 6rpx;
	}

	/* 物流 */
	.wanl-user-order .logistics {
		background-color: #f9f9f9;
		border-radius: 24rpx;
	}

	.wanl-user-order .logistics .swiper {
		height: 120rpx;
	}

	.wanl-user-order .logistics .swiper .title {
		display: flex;
		justify-content: space-between;
		margin-bottom: 10rpx;
		color: #999999;
	}

	.wanl-user-order .logistics .swiper .cu-avatar {
		margin-right: 10rpx;
		height: 66rpx;
		width: 66rpx;
		border-radius: 12rpx;
		background-color: #ffffff;
	}

	.wanl-user-order .logistics .swiper .content .text-df {
		color: #3797e0;
		font-size: 27rpx;
		margin-bottom: 2rpx;
	}

	.wanl-user-order .logistics .swiper .content .text-sm {
		color: #999999;
	}

	.wanl-user-order .logistics .swiper .content text {
		font-size: 32rpx;
		margin-left: 15rpx;
		margin-right: 10rpx;
	}

	/* 工具箱 */
	.wanl-user-tool {
		background-color: #ffffff;
		border-radius: 24rpx;
	}

	.wanl-user-tool .title {
		display: flex;
		justify-content: space-between;
		align-items: flex-end;
	}

	.wanl-user-tool .title text {
		margin-left: 2rpx;
	}

	/* 状态 */
	.wanl-user-tool .list {
		text-align: center;
	}

	.wanl-user-tool .list>view {
		margin-bottom: 28rpx;
		position: relative;
	}

	.wanl-user-tool .list>view .cu-tag {
		top: -8rpx;
		left: 80rpx;
		right: unset;
	}

	.wanl-user-tool .list text {
		display: block;
		font-size: 54rpx;
		margin-bottom: 8rpx;
	}

	.user-action {
		text-align: center;
		padding: 36rpx 66rpx;
		background-color: #fff;
		border-radius: 12rpx;
		margin-top: 20rpx;
	}

	.action-shop {
		display: inline-flex;
		justify-content: space-between;
		align-items: center;
		width: 340rpx;
	}
</style>